const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const shopCarSchema = new Schema({
    userId: { type: Schema.Types.ObjectId, ref: 'muser' }, //
    sid: { type: String, required: true }, // 购物车分组ID，唯一标识符
    goodId: { type: Schema.Types.ObjectId, ref: 'good' }, // 商品ID，关联到商品表的ID字段
    quantity: { type: Number, default: 1 }, // 商品数量，默认为1
    createTime: { type: Number, default: Date.now } //
});
const ShopCar = mongoose.model('shopCar', shopCarSchema);
module.exports = ShopCar;